import logging

import redis


class Config(object):
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    SECRET_KEY = 'xxx'
    # session 系列
    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_PERMANENT = 86400


class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql://root:xxx@127.0.0.1:3306/information'
    LOG_LEVEL = logging.DEBUG


class ProductConfig(Config):
    DEBUG = False
    # SQLALCHEMY_DATABASE_URI = 'pymysql + mysql://root:xxx@127.0.0.1:3306/flask_project'
    LOG_LEVEL = logging.ERROR


config_map = {
    'develop': DevelopmentConfig,
    'product': ProductConfig

}